
## Languages supported
set(LINGUAS zh_CN CACHE STRING "Language list" FORCE)

## Environment
if((${CMAKE_INSTALL_PREFIX} STREQUAL "/opt"))
    set(INSTALL_BASE_DIR "apps/${TOP_PROJECT_NAME}")
    set(INSTALL_DATA_DIR "${INSTALL_BASE_DIR}")
    set(INSTALL_PLUGINS_DIR "${INSTALL_BASE_DIR}/plugins")
    set(CMAKE_INSTALL_BINDIR "${INSTALL_BASE_DIR}")
    set(CMAKE_INSTALL_LIBDIR "${INSTALL_BASE_DIR}/libs")

    set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
    set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
else()
    include(GNUInstallDirs)
    set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${TOP_PROJECT_NAME}")
    set(INSTALL_DATA_DIR "${CMAKE_INSTALL_DATADIR}/${TOP_PROJECT_NAME}")
    set(INSTALL_PLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/plugins")
endif()

set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(INSTALL_PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_PLUGINS_DIR}")
set(INSTALL_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA_DIR}/assets")
set(INSTALL_TRANSLATIONS_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA_DIR}/translations")
set(INSTALL_DESKTOP_DIR "/usr/share/applications")
set(INSTALL_ICONS_DIR "/usr/share/icons/hicolor/scalable/apps/")
set(INSTALL_BIN_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${TOP_PROJECT_NAME}")

if(TRANSLATION_EMB)
    set(TRANSLATION_PATH_PREFIX ":")
    set(TRANSLATION_PATH "/i18n")
else()
    set(TRANSLATION_PATH_PREFIX "")
    set(TRANSLATION_PATH "${INSTALL_TRANSLATIONS_DIR}")
endif()

set(APPLICATION_NAME ${TOP_PROJECT_NAME})
set(APPLICATION_VERSION ${PROJECT_VERSION})
set(APPLICATION_PLUGINS_PATH ${INSTALL_PLUGINS_DIR})
set(APPLICATION_ASSETS_PATH ${INSTALL_ASSETS_DIR})
set(APPLICATION_TRANSLATIONS_PATH "${TRANSLATION_PATH_PREFIX}${TRANSLATION_PATH}")

## Global Configuration
configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h @ONLY)
include_directories(BEFORE ${CMAKE_BINARY_DIR})
